package com.ls.controller;


import com.ls.model.Department;
import com.ls.service.DeptService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class DeptController {

    @Autowired
    private DeptService deptService;

    @GetMapping("/service/depts")
    public List<Department> depts() {
        List<Department> depts = deptService.list();
        System.out.println("depts执行了");
        return depts;
    }
}
